package com.prs.crm.domain.oa;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.prs.crm.domain.BaseEntity;

/**
 * OA档案类目
 * @author zhoupeng 2012-3-22
 *
 */
@Entity
@Table(name="oa_archives")
public class Archives extends BaseEntity{
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	private String code;
	private String name;
	private String remark;
	@ManyToOne
	private Archives parent; //父类目
	//子类目
	@OneToMany(fetch=FetchType.LAZY,mappedBy="parent")
	private Set<Archives> childs;
	@OneToMany(fetch=FetchType.LAZY,mappedBy="archives")
	private Set<ArchivesCategory> categorys;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Archives getParent() {
		return parent;
	}
	public void setParent(Archives parent) {
		this.parent = parent;
	}
	public Set<Archives> getChilds() {
		return childs;
	}
	public void setChilds(Set<Archives> childs) {
		this.childs = childs;
	}
	public Set<ArchivesCategory> getCategorys() {
		return categorys;
	}
	public void setCategorys(Set<ArchivesCategory> categorys) {
		this.categorys = categorys;
	}
	
}
